package com.spring4a.stereo_javaconfig.soundsystem;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by Temp on 2017/9/18.
 */
@Component
public class CDPlayer implements MediaPlayer {

    private SgtPappers sgtPappers;

    @Bean
    public SgtPappers sgtPappers() {
        return new SgtPappers();
    }

    public CDPlayer(SgtPappers sgtPappers) {
        this.sgtPappers = sgtPappers();
    }

    @Bean
    public CDPlayer cDPlayer () {
        return new CDPlayer(sgtPappers());
    }

    public void play() {
        sgtPappers.play();
    }
}
